﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for DALDanhMuc
/// </summary>
public class DALDanhMuc : StandardConnectDB, IDanhMuc
{
    public DALDanhMuc()
    {

    }


    #region IDanhMuc Members

    public DanhMuc getDanhmucByID(string id)
    {
        DanhMuc dtoDanhMuc = new DanhMuc();
           
        Dictionary<String, Object> paramlist = new Dictionary<String, Object>();
        paramlist.Add("@id", id);
        DataTable dt = this.DTExecuteSelect("SelectDMbyID", paramlist);
        if (dt != null)
        {
            dtoDanhMuc.MaDM = dt.Rows[0]["MADM"].ToString();
            dtoDanhMuc.TenDM = dt.Rows[0]["TENDM"].ToString();
        }
        return dtoDanhMuc;
        
    }

    #endregion

    #region IDanhMuc Members


    public DataTable getAllDanhMuc()
    {
        Dictionary<String, Object> paramlist = new Dictionary<String, Object>();
        return this.DTExecuteSelect("getAllDanhMuc", paramlist);
    }

    #endregion
}
